package mark.tom.sail;

import android.text.TextUtils;

import androidx.annotation.NonNull;

import java.util.HashMap;
import java.util.Map;

import static mark.tom.sail.Util.checkEmpty;

public class AnalyticsRecord {

    private final Map<String, Object> logData = new HashMap<String, Object>();

    public AnalyticsRecord put(@NonNull String tag, @NonNull Object data) {
        checkEmpty(data);
        if (TextUtils.isEmpty(tag)) {
            throw new NullPointerException("tag must not be null or empty");
        }
        logData.put(tag, data);
        return this;
    }

    Map<String, Object> get() {
        return logData;
    }
}
